const mongoose = require("mongoose")
const ObjectId = mongoose.Schema.Types.ObjectId;
//评价
const CommentSchema = new mongoose.Schema({
    order: String,//订单（服务和商品）
    shop: {//服务门店
        type: ObjectId,
        ref: "Shop"
    },
    totalMoney: Number,//订单总金额
    score: Number,//评分
    content: String,//评分内容
    avatar: String,//头图
    character: String,//评论性质，正常、纠纷、刷单、水贴、其他
    commentator: String//评论人

}, {

        versionKey: false,
        timestamps: {
            createdAt: 'createTime',
            updatedAt: 'updateTime'
        } //自动管理修改时间
    })

module.exports = mongoose.model("Comment", CommentSchema);